package com.tarena.lbs.content.exception;

import com.tarena.lbs.base.protocol.exception.BusinessException;
import com.tarena.lbs.base.protocol.model.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {
	
	@ExceptionHandler
	public Result handleBusinessException(BusinessException e) {
		log.error("业务异常：{}", e.getMessage());
		return Result.fail(e);
	}
	
}
